package cn.schoolwow.workflow.domain.instance;

/**工作流实例状态*/
public enum WorkFlowInstanceStatus {
    /**进行中*/
    Running(0),
    /**已完成*/
    Finished(1),
    /**已撤回*/
    Revoke(2),
    /**已拒绝*/
    Reject(3);

    public int status;

    WorkFlowInstanceStatus(int status) {
        this.status = status;
    }

    public static WorkFlowInstanceStatus getWorkFlowInstanceStatusByStatus(int status){
        WorkFlowInstanceStatus[] workFlowInstanceStatuses = WorkFlowInstanceStatus.values();
        for(WorkFlowInstanceStatus workFlowInstanceStatus:workFlowInstanceStatuses){
            if(workFlowInstanceStatus.status==status){
                return workFlowInstanceStatus;
            }
        }
        throw new IllegalArgumentException("不合法的审批状态字段!当前值:"+status);
    }
}
